/**
 * 
 */
package com.thor.palmmall.rest.brand.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.brand.ABizType;
import com.thor.palmmall.spi.brand.SBizType;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class SBizTypeConverter implements Converter<ABizType, SBizType> {

  public static SBizTypeConverter getInstance() {
    if (instance == null)
      instance = new SBizTypeConverter();
    return instance;
  }

  private static SBizTypeConverter instance;

  private SBizTypeConverter() {
  }

  @Override
  public SBizType convert(ABizType source) {
    if (source == null) {
      return null;
    }
    SBizType target = new SBizType();
    target.setUuid(source.getUuid());
    target.setCode(source.getCode());
    target.setName(source.getName());
    target.setLevelId(source.getLevelId());
    return target;
  }

}
